﻿
@{
    TipsInfo tipsInfo = ViewBag.TipsInfo;
    Layout = "~/Areas/Member/Views/_LoginLayoutPage.cshtml";
    ViewBag.Title = "OAuth2.0登录";
}

<div class="container">
    <div class="loginBox">
        <div class="row header">
            <div class="col-md-6 col-xs-6 hidden">
                <a href="/">返回首页</a>
            </div>
            <div class="col-md-6 col-xs-6 text-right">
                没有账户？<a href="@Url.ActionUrl("Index","Reg")">去注册</a>
            </div>
        </div>
        <div class="content-box">
            <div class="media logo-media"></div>
            <div class="login-sign">OAuth2.0登录</div>
            <div id="LoginBox">

            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    var open =@ViewBag.Open;
    var state=@tipsInfo.State;
    var msg = "@tipsInfo.Msg";
    var $loginBox = $("#LoginBox");
    //初始化
    function Init()
    {
        if (open == 0) {
            $loginBox.text("对不起，网站登录已经关闭！");
        }
        if (state == 0)
        {
            $loginBox.text(msg);
        }
    }
    Init();
    function Login()
    {
            layer.msg('授权成功...', {
                icon: 16,
                time: 200000, //200秒
                shade: 0.01
       });
            var to = Request("to");
            if (to == "") {
                to="@Url.ActionUrl("Index","Default")";
            }
            top.location.href = to;

    }
    if (state == 1)
    {
        Login();
    }
</script>
